from rest_framework import serializers
#from rest_framework import response
from book import models as  models_book
from account import models as models_account
import base64
from utils import utils


class MyBookSerializer(serializers.ModelSerializer):
    class Meta:
        model=models_book.Book
        fields = ('id','name','cover', 'author', 'university' )


class AccountBookBaseSerializer(serializers.ModelSerializer):
    class Meta:
        model=models_account.AccountBook
        fields = '__all__'


class AdviceSerializer(serializers.ModelSerializer):
    class Meta:
        model = models_account.Advice
        fields = '__all__'

class AccountSerializer(serializers.ModelSerializer):
    class Meta:
        model = models_account.Account
        fields = ('username', 'nickname', 'gender', 'avatarUrl', 'university', 'phone')
